<template>
	<view class="width100">
		<cu-custom bgColor="bg-white" :isBack="true">
			<block slot="content">提现记录</block>
		</cu-custom>
		<view class="content"  v-for="(obj,index) in waterList" :key="index" >
			<view class="contents" v-if="waterList.length">
				<view>
					<text style="font-size: 16px;">{{obj.operatime}}</text>
					<text style="float: right; font-size: 20px;">¥{{obj.transnum}}</text>
				</view>
				<view style="color: #808080; margin:3px 0 10px 0 ;">{{obj.transtime}}</view>
				<view>
					<text>提款至：</text>
					<text style="margin-left: 10px; color: #808080;">尾号{{obj.bankcardnum}}</text>
					<text style="float: right; font-weight: 550;">{{object[obj.transtatus]}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	var _self;
	var canvaRing = null;
	
	 export default {
			data(){
				return{
				transnum:'',
				waterList:[],
				object:{
					N:'处理中',
					Y:'已完成',
				},
			}
	  },
		onLoad() {
			_self = this;
			this.getwaterList();
	    },
	   methods:{
			async getwaterList(data) {
				 this.waterList = await this.$apis.getwaterList({
					pagenum:'1'
				});
				console.log(this.waterList);
				let res = this.waterList;
				this.obj = this.handleTime(res);
		   },
		   handleTime(list) {
		   	list.map(item => {
				let operatime = item.operatime.substring(0, 4) + "年" + item.operatime.substring(4,6,) +"月"+item.operatime.substring(6,8) +'日'
		   		let transtime = item.operatime.substring(8, 10) + ":" + item.operatime.substring(10,12) +":"+item.operatime.substring(12,14)
				let bankcardnum = item.bankcardnum.substring(14,18);
		   		item.operatime = operatime;
		   		item.transtime = transtime;
				item.bankcardnum = bankcardnum;
		   		return item
		   	})
		   	return list;
		   },
		},
	}
</script>

<style>
	.content{
		width:92%;
		margin: 20px auto;
		padding: 0px;
		background-color: #FFFFFF;
		border-radius: 10px;
	}
	.contents{
		padding: 15px;
	}
</style>
